Boomy DDS SDK Development Guide III
I. About
This document guides readers to write control code via LowController, send commands to the robot, drive it to perform corresponding motions, and reproduce the demonstration effect.
This document consists of four sections. Section 2 covers preliminary preparation. Section 3 explains code cloning, code annotation, deployment path and compilation operations in sequence, guiding you to make the left shoulder joint perform sinusoidal reciprocating motion centered on its initial position. Section 4 covers final effect verification and demonstration.
Automation function objective: Use LowController to control the left shoulder joint to perform sinusoidal reciprocating motion centered on its initial position.
II. Prerequisites
Environment Specifications
Operating System: Ubuntu 22.04
Note: ROS environment is not required for SDK compilation
Supported Architectures: x86_64 / ARM
(I) Connect to the Robot
1.Wired Connection
-
Prepare a standard household RJ45 Ethernet cable.
-
Set the IP address of your PC’s wired network interface to 192.168.55.100 (values from 103 to 110 are also acceptable) , and the subnet mask to 255.255.255.0.
-
With this configuration, connect your PC directly to the Boomy robot via the Ethernet cable. Run the
ping 192.168.55.102command. A successful ping indicates that the communication link works properly.

- Connect to the robot computing board via SSH service
ssh noetix@192.168.55.101 #Connect to the compute board, Password: Boomy
2.Wireless Connection
- Obtain the wireless IP: Check the robot Wi‑Fi IP from the Wi‑Fi connection status on the mobile App. (The compute board uses the motion control board’s Wi‑Fi module.)

- Run the connection command: Connect using the command with port parameters.
ssh -p 2222 noetix@[Robot WIFI-IP]
(II) SDK Source Code Acquisition, Build and Compilation
Obtain the SDK Source Code
Official URL:GitHub - Noetix-Robotics/noetix_sdk_boomy: This is SDK for Noetix robot Boomy with DDS interface.
III. Start
(I) Clone the SDK
git clone git@github.com:Noetix-Robotics/noetix_sdk_boomy.git
cd noetix_sdk_boomy
(II) Start of C++ Code
1.Create the src folder
mkdir src
2.Write the main.cpp file under the src folder.
vim src/main.cpp
#include "lowcontroller.h"
#include <unistd.h>
#include <array>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <mutex>
#include <chrono>
#include <thread>
using namespace noetix;
std::mutex status_mutex;
RobotHardwareStatus latest_status;
bool status_received = false;
// Ctrl+C Exit flag
static volatile sig_atomic_t g_running = 1;
static void sigint_handler(int) { g_running = 0; }
// Receive robot hardware status
void hardware_status_callback(const RobotHardwareStatus &status)
{
{
std::lock_guard<std::mutex> lock(status_mutex);
latest_status = status;
status_received = true;
}
}
int main(int argc, char *argv[])
{
// 1. Configure DDS environment
char buf[256];
getcwd(buf, sizeof(buf));
std::string path = std::string(buf);
std::string ddsxml = "file://" + path + "/config/dds.xml";
setenv("CYCLONEDDS_URI", ddsxml.c_str(), 1);
printf("Current path: %s\n", path.c_str());
fflush(stdout);
// 2. Initialize LowController
LowController *ctrl = LowController::Instance();
if (!ctrl->init()) {
printf("LowController init failed!\n");
return -1;
}
// 3. After init, send a full-zero gain command immediately (consistent with the official example_low,
// to ensure the SDK internal sending thread works properly; kp/kd set to 0 will not drive any joints).
std::array<MotorCmd, 21> motorcmd{};
for (int i = 0; i < 21; i++) {
motorcmd[i].motor_id = i;
motorcmd[i].pos = 0;
motorcmd[i].vel = 0;
motorcmd[i].tau = 0;
motorcmd[i].kp = 0;
motorcmd[i].kd = 0;
}
ctrl->set_joint(motorcmd);
// 4. Subscribe to robot hardware status
ctrl->subscribe_robot_hardware_status(hardware_status_callback);
// 5. Poll and wait for joint feedback (max 5 seconds)
for (int i = 0; i < 50 && !status_received; i++)
sleep_ms(100);
if (!status_received) {
printf("Wait for hardware status timeout!\n");
return -1;
}
// 6. Get and verify the target joint index (can be specified via argv [1], default to left shoulder)
const char *joint_name = (argc > 1) ? argv[1] : "arm_l1_joint";
int joint_id = ctrl->getJointsIndex(joint_name);
if (joint_id < 0 || joint_id >= 21) {
printf("Invalid joint index %d for joint '%s'\n", joint_id, joint_name);
return -1;
}
printf("Joint '%s' -> index %d\n", joint_name, joint_id);
// 7. Get current actual position
double initial_pos;
{
std::lock_guard<std::mutex> lock(status_mutex);
if (latest_status.motor_data[joint_id].motor_id != joint_id) {
printf("Motor ID does not match array index!\n");
return -1;
}
initial_pos = latest_status.motor_data[joint_id].pos;
}
printf("Initial position: %.3f rad\n", initial_pos);
fflush(stdout);
// 8. Motion parameters
// Amplitude: Shoulder pitch travel ±2.36 rad. 0.4 rad ≈ ±23°, clearly visible to the naked eye;
// If set to 0.05 rad (±2.9°), it appears as "only stiffness without motion".
// Gain: Driving torque = kp × error, damping torque = kd × actual velocity.
// kp=100, kd=1: Driving torque 40 N·m >> damping torque (0.6 N·m at 0.6 rad/s), capable of tracking the sine wave.
// kp=5, kd=5: Driving torque 2 N·m < damping torque 3 N·m → suppressed by damping, stiff without movement.
// Reduce kp or increase kd if jitter/oscillation occurs; increase kp if the response is sluggish and fails to track.
const double amplitude = 0.4; // Motion amplitude, unit: rad
const double kp = 100.0; // Position gain
const double kd = 1.0; // Velocity damping (excessive value will offset the driving torque)
const double pi = 3.141592653589793;
const double period = 4.0; // One full cycle lasts 4 seconds.
printf("Start motion on joint '%s' (joint_id=%d), Ctrl+C to stop\n",
joint_name, joint_id);
fflush(stdout);
signal(SIGINT, sigint_handler);
// 9. Loop control
auto start_time = std::chrono::steady_clock::now();
int print_count = 0;
while (g_running) {
auto now = std::chrono::steady_clock::now();
double elapsed =
std::chrono::duration<double>(now - start_time).count();
// Perform sinusoidal reciprocating motion centered on the initial position.
double target_pos =
initial_pos + amplitude *
std::sin(2.0 * pi * elapsed / period);
motorcmd[joint_id].pos = target_pos;
motorcmd[joint_id].vel = 0;
motorcmd[joint_id].tau = 0;
motorcmd[joint_id].kp = kp;
motorcmd[joint_id].kd = kd;
ctrl->set_joint(motorcmd);
// 50 Hz control. Print target and actual position every 10 frames to verify tracking performance.
if (++print_count % 10 == 0) {
double actual_pos;
{
std::lock_guard<std::mutex> lock(status_mutex);
actual_pos = latest_status.motor_data[joint_id].pos;
}
printf("target: %+.3f rad | actual: %+.3f rad | err: %+.3f\n",
target_pos, actual_pos, target_pos - actual_pos);
fflush(stdout);
}
std::this_thread::sleep_for(std::chrono::milliseconds(20));
}
// 10. Release joints before exit (zero out gains to prevent holding the target position continuously).
motorcmd[joint_id].pos = 0;
motorcmd[joint_id].vel = 0;
motorcmd[joint_id].tau = 0;
motorcmd[joint_id].kp = 0;
motorcmd[joint_id].kd = 0;
ctrl->set_joint(motorcmd);
printf("Motion stopped, joint released\n");
fflush(stdout);
sleep_ms(100);
_exit(0);
}
For motor-related interfaces in the code, refer to the following.
| Function Name | set_joint |
|---|---|
| Function Prototype | void set_joint(std::array<MotorCmd, 21> motorcmd) |
| Function Overview | Set joint data |
| Parameters | motorcmd: motor command structure |
| Return Value | None |
| Remarks |
| Function Name | subscribe_robot_hardware_status |
|---|---|
| Function Prototype | void subscribe_robot_hardware_status(RobotHardwareStatusCallback callback); |
| Function Overview | Subscribe to robot hardware status information |
| Parameters | - callback:Callback function for processing robot status data |
| Return Value | None |
| Remarks | Usage is the same as HighController. subscribe_robot_hardware_status |
| Parameter Name | Definition Prototype | Example Value | Description |
|---|---|---|---|
| MotorCmd | | pos | Motor position |
| vel | Motor speed | ||
| tau | Motor torque | ||
| kp | PID parameter | ||
| kd | PID parameter | ||
| motor_id | Motor ID |
| ID | Name | Joint | Angle Range | Radian Range | ||
|---|---|---|---|---|---|---|
| 0 | arm_l1_joint | Left arm shoulder joint pitch | -135 | 135 | -2.36 | 2.36 |
| 1 | arm_l2_joint | Left arm shoulder joint roll | -8 | 111 | -0.14 | 1.94 |
| 2 | arm_l3_joint | Left arm joint yaw | -90 | 90 | -1.57 | 1.57 |
| 3 | arm_l4_joint | Left arm elbow joint pitch | -129 | 0 | -2.26 | 0.00 |
| 4 | leg_l1_joint | Left leg hip joint pitch | -120 | 120 | -2.09 | 2.09 |
| 5 | leg_l2_joint | Left leg hip joint roll | -38 | 90 | -0.66 | 1.57 |
| 6 | leg_l3_joint | Left thigh joint yaw | -145 | 145 | -2.53 | 2.53 |
| 7 | leg_l4_joint | Left leg knee joint pitch | 0 | 128 | 0.00 | 2.24 |
| 8 | leg_l5_joint | Left leg ankle joint pitch | -55 | 25 | -0.96 | 0.44 |
| 9 | leg_l6_joint | Left leg ankle joint roll | -10 | 10 | -0.17 | 0.17 |
| 10 | arm_r1_joint | Right arm shoulder joint pitch | -135 | 135 | -2.36 | 2.36 |
| 11 | arm_r2_joint | Right arm shoulder joint roll | -111 | 8 | -1.94 | 0.14 |
| 12 | arm_r3_joint | Right arm joint yaw | -90 | 90 | -1.57 | 1.57 |
| 13 | arm_r4_joint | Right arm elbow joint pitch | -129 | 0 | -2.26 | 0.00 |
| 14 | leg_r1_joint | Right leg hip joint pitch | -120 | 120 | -2.09 | 2.09 |
| 15 | leg_r2_joint | Right leg hip joint roll | -90 | 38 | -1.57 | 0.66 |
| 16 | leg_r3_joint | Right thigh joint yaw | -145 | 145 | -2.53 | 2.53 |
| 17 | leg_r4_joint | Right leg knee joint pitch | 0 | 128 | 0.00 | 2.24 |
| 18 | leg_r5_joint | Right leg ankle joint pitch | -55 | 25 | -0.96 | 0.44 |
| 19 | leg_r6_joint | Right leg ankle joint roll | -10 | 10 | -0.17 | 0.17 |
| 20 | waist_1_joint | Waist joint yaw | -90 | 90 | -1.57 | 1.57 |
For more details, refer to: Boomy Comprehensive Usage Document
3.Modify CMakeLists.txt Build File
Modify the content of the CMakeLists.txt file under this path:
- Add Example
Locate add_executable(example_media examples/cpp/example_media.cpp) in the file, and append the newly written code right below this line.
add_executable(main src/main.cpp)
add_executable is a CMake command, which is used to define an executable target
- Set Path
Similarly, locate target_include_directories in the file and add content below this line.
target_include_directories sets header search paths for the target example_standswing
target_include_directories(main
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
- Specify Linking
Similarly, locate target_link_libraries in the file and add content below this line.
target_link_libraries is used to specify libraries to link for the given target. It tells the linker to combine symbols and functions from these libraries into the final executable.
target_link_libraries(main
Threads::Threads
noetix_boomy_sdk
${DDS_LIB_DIR}/libddsc.so
${DDS_LIB_DIR}/libddscxx.so
)
- Full CMakeLists.txt File
4.Compile the Code
Save and exit, then run the build script in the project root directory.
./build.sh
As shown below:

5.Run the Code
sudo ./build/main
(III) Python Start
1.Create main.py Python File
Write main.py under the src folder.
vim src/main.py
2.Write Python Code
"""
Control the left shoulder joint to perform sinusoidal reciprocating motion centered on its initial position.
The joint will be released (gains cleared) when exiting via Ctrl+C.
"""
import math
import os
import sys
import threading
from time import perf_counter, sleep
# DDS environment configuration (parse the project root directory based on the script location, independent of the runtime directory)
PROJECT_ROOT = os.path.abspath(
os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
)
os.environ["CYCLONEDDS_URI"] = "file://" + os.path.join(PROJECT_ROOT, "config", "dds.xml")
sys.path.append(os.path.join(PROJECT_ROOT, "build"))
from lowcontrol_py import *
# Motion Parameters
AMPLITUDE = 0.05 # Motion amplitude, unit: rad
KP = 2.0 # Example gains, to be verified on the real robot.
KD = 2.0 # Example gains, to be verified on the real robot.
PERIOD = 4.0 # One full cycle is 4 seconds.
JOINT_NAME = "arm_l1_joint"
NUM_JOINTS = 21
CONTROL_DT = 0.02 # Approximately 50 Hz.
# Hardware state cache
status_lock = threading.Lock()
latest_status = [None]
status_received = threading.Event()
def hardware_status_callback(status):
"""Receive robot hardware status (this callback runs in the SDK thread)."""
with status_lock:
latest_status[0] = status
status_received.set()
def make_zero_cmds():
"""Initialize control commands for 21 joints (gains set to 0, other joints not driven)."""
cmds = [MotorCmd() for _ in range(NUM_JOINTS)]
for i in range(NUM_JOINTS):
cmds[i].motor_id = i
cmds[i].pos = 0.0
cmds[i].vel = 0.0
cmds[i].tau = 0.0
cmds[i].kp = 0.0
cmds[i].kd = 0.0
return cmds
def main():
# 1. Initialize LowController
ctrl = LowController.instance()
if not ctrl.init():
print("LowController init failed!")
return -1
# 2. Subscribe to robot hardware status
ctrl.subscribe_robot_hardware_status(hardware_status_callback)
# 3. Wait for joint feedback to be received.
if not status_received.wait(timeout=5.0):
print("Wait for hardware status timeout!")
return -1
# 4. Get and verify the left shoulder joint index.
joint_id = ctrl.getJointsIndex(JOINT_NAME)
if joint_id < 0 or joint_id >= NUM_JOINTS:
print(f"Invalid joint index: {joint_id}")
return -1
# 5. Get current actual position
with status_lock:
status = latest_status[0]
if status.motor_data[joint_id].motor_id != joint_id:
print("Motor ID does not match array index!")
return -1
initial_pos = status.motor_data[joint_id].pos
print(f"Left elbow initial position: {initial_pos:.3f} rad")
# 6. Initialize control commands for 21 joints.
cmds = make_zero_cmds()
print("Start left elbow motion... (Ctrl+C to stop)")
# 7. Loop control
start_time = perf_counter()
try:
while True:
elapsed = perf_counter() - start_time
target_pos = initial_pos + AMPLITUDE * math.sin(
2.0 * math.pi * elapsed / PERIOD
)
cmds[joint_id].pos = target_pos
cmds[joint_id].vel = 0.0
cmds[joint_id].tau = 0.0
cmds[joint_id].kp = KP
cmds[joint_id].kd = KD
ctrl.set_joint(cmds)
print(f"Target position: {target_pos:.3f} rad")
sleep(CONTROL_DT)
except KeyboardInterrupt:
print("\nStopping...")
# 8. Release joints before exit (clear gains to avoid holding the target position).
cmds[joint_id].pos = 0.0
cmds[joint_id].vel = 0.0
cmds[joint_id].tau = 0.0
cmds[joint_id].kp = 0.0
cmds[joint_id].kd = 0.0
ctrl.set_joint(cmds)
print("Motion stopped, joint released")
return 0
if __name__ == "__main__":
sys.exit(main())
3.Compile the Code
After saving and exiting, run the compilation script in the project root directory to generate link files required for Python.
./build.sh
4.Run the Code
After compilation, run the Python code in the project root directory.
python3 src/main.py
IV. Demonstration
The following is the actual robot running effect.
Google Drive video link:https://drive.google.com/file/d/1iLTziQSaM8r4f2BB_i3K59u65uMiZIew/view?usp=drive_link